import 'package:custom_widgets/item_normal_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ui_demo/res/strings.dart';

class SettingPage extends StatefulWidget {
  SettingPage({Key? key}) : super(key: key);

  @override
  _SettingPageState createState() => _SettingPageState();
}

class _SettingPageState extends State<SettingPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(AppStrings.TAB_SETTING),
        centerTitle: true,
        elevation: 0.5,
      ),
      body: SafeArea(
        child: SingleChildScrollView(
          child: _buildBody(),
        ),
      ),
    );
  }

  Widget _buildBody() {
    return Column(
      children: <Widget>[
        ItemNormalWidget.item(
          title: "主题",
          onTap: () {},
        ),
        ItemNormalWidget.item(
          title: "语言",
          onTap: () {},
        ),
        ItemNormalWidget.item(
          title: "字体",
          onTap: () {},
        ),
        ItemNormalWidget.item(
          title: "字体大小",
          onTap: () {},
        ),
        ItemNormalWidget.switchItem(
          title: "夜间",
          value: false,
          onChanged: (bool val) {},
        ),
      ],
    );
  }
}
